package org.example.rabbitmqspring.listener;

import com.rabbitmq.client.Channel;
import org.example.rabbitmqspring.constant.Constants;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@Component
public class WorkQueueListener {
    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void workQueueListener1(org.springframework.amqp.core.Message message, Channel channel) {
        System.out.println("工作队列模式消费的消息: " + message + "信道: " + channel);
    }

    @RabbitListener(queues = Constants.WORK_QUEUE)
    public void workQueueListener2(Message message, Channel channel) {
        System.out.println("工作队列模式消费的消息: " + message + "信道: " + channel);
    }


}
